<?php

//include(index.html);


$a[0][0]='San Sebastian';
$a[1][0]='Lasarte';
$a[2][0]='Andoain';
$a[0][1]='Bilbao';
$a[1][1]='Barakaldo';
$a[0][2]='Vitoria';

$b[0][0]='calle San Sebastian';
$b[1][0]='calle san sebastian2';
$b[0][1]='calle Lasarte';
$b[1][1]='calle Lasarte2';
$b[0][2]='calle Andoain';
$b[1][2]='calle Andoain1';

$valor=$_GET['combo'];
$num=$_GET['num'];



switch ($num)
{
	case 'myDiv1':
		echo "<form id='form'>";
			//echo "<input type='hidden' value='1' id='num'>";
			echo "<SELECT id=combo1 onChange=getArray('calles','combo1')>";
			for($cont=0;$cont<sizeof($a[$valor]);$cont++){
				echo "<OPTION value='$cont'>".$a[$cont][$valor]."</OPTION>";
			}
			echo "</SELECT>";
		echo "</form>";
		
	break;
  
	case 'calles':
		echo "<form id='form'>";
		echo "<input type='hidden' value='2' id='num'>";
			echo "<SELECT NAME='combo2'>";
				for($cont=0;$cont<sizeof($b[$valor]);$cont++){
					echo "<OPTION value='$cont'>".$b[$cont][$valor]."</OPTION>";
				}
			echo "</SELECT>";
		echo "</form>";
	break;
  
} 

?>
